<?php
use yii\helpers\Url;
use yii\Web\View;
use app\assets\BlackWhiteListAsset;
BlackWhiteListAsset::register($this);
$this->title = $this->context->pageTitle.Yii::$app->params['titleSuffix'];
$this->params['breadcrumbs'] = [
  [
    'label' => '媒体列表',
    'url' => ['index']
  ],
  '黑白名单',
  '数据'
];
?>
<div class="page-header">
  <h1>
    资源管理
    <small>黑白名单列表</small>
    <div class="btn-group pull-right" role="group" aria-label="...">
      <a href="<?= Url::to(['new-black-white']);?>" class="btn btn-sm btn-success" data-loading-text="<i class='fa fa-spinner fa-spin'></i> 加载中..." id="new-operate-btn">
        <i class="fa fa-plus-circle"></i>
        新增名单
      </a>
    </div>
  </h1>
</div>
<div class="panel panel-default">
  <div class="panel-heading">
    <i class="fa fa-table"></i>
    数据列表
    <ul class="list-inline list-unstyled pull-right">
      <li>
        <a class="data-table-refresh" href="#" title="点击刷新数据">
          <i class="fa fa-refresh"></i>
        </a>
      </li>
      <li>
        <a href="#">
          <i class="fa fa-chevron-up"></i>
        </a>
      </li>
    </ul>
  </div>
	<div class="panel-body">
    <div id="list-loading-wrap" class="local-loading-wrap"></div>
    <div class="table-responsive">
      <table class="table table-hover table-striped table-bordered table-condensed" id="data-table">
        <thead class="heading">
          <tr>
            <th>ID</th>
            <th>名称</th>
            <th>名单类型</th>
            <th>包含域名</th>
            <th>更新时间</th>
            <th class="tab-op">操作</th>
          </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
    </div>
	</div>
</div>
<?php
  $url = Yii::getAlias('@web') . '/response/mediaList/blackWhiteDataList.php';
  $editUrl = Url::to(['media-list/black-white-edit']);
  $listDeleteOpUrl = Url::to(['media-list/list-operate-handle']);
  $this->registerJs("VAM.setVar('DATA_LIST_URL', '$url')", View::POS_HEAD);
  $this->registerJs("VAM.setVar('DATA_EDIT_URL', '$editUrl')", View::POS_HEAD);
  $this->registerJs("VAM.setVar('LIST_DELETE_OP_URL', '$listDeleteOpUrl')", View::POS_HEAD);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/mediaList/blackWhiteList.js"]);
  });
</script>